package encapsulation.b;

// JavaBean
public class User {
    private String name;
    private int age;
    private int id;
    private boolean man;

    public void printUserInfo(){
        System.out.println("姓名:" + name);
        System.out.println("年龄:" + age);
        System.out.println("id:" + id);
        System.out.println("性别:" + man);
    }

    // 获取姓名
    public String getName() {
        return name;
    }
    // 设置姓名
    public void setName(String name) {
        this.name = name;
    }
    // 获取年龄
    public int getAge() {
        return age;
    }
    // 设置年龄
    public void setAge(int age) {
        this.age = age;
    }
    // 获取id
    public int getId() {
        return id;
    }
    // 设置id
    public void setId(int id) {
        this.id = id;
    }
    // 获取性别
    public boolean isMan() {
        return man;
    }
    // 设置性别
    public void setMan(boolean man) {
        this.man = man;
    }
    
    

    

}
